package org.activequant.util.ib.marketscanners;

public enum Location {
 STK_US("STK.US", "US Stocks", "STK", "NYSE"),
 FUT_US("FUT.US", "US Futures", "FUT.US", "GLOBEX"),
 IND_US("IND.US", "US Indexes", "IND.US", "NYSE"),
 BOND_US("BOND.US", "US Corporate Bonds", "BOND", "VALUBOND"),
 EFP("EFP", "IBEFP", "EFP", "ONE"),
 STK_NA("STK.NA", "America Non-US Stocks", "STOCK.NA", "TSE"),
 FUT_NA("FUT.NA", "America Non-US Futures", "FUT.NA", "CDE"),
 STK_EU("STK.EU", "Europe Stocks", "STOCK.EU", "LSE"),
 FUT_EU("FUT.EU", "Europe Futures", "FUT.EU", "DTB"),
 IND_EU("IND.EU", "Europe Indexes", "IND.EU", "DTB"),
 STK_HK("STK.HK", "Asia Stocks", "STOCK.HK", "TSE.JPN"),
 FUT_HK("FUT.HK", "Asia Futures", "FUT.HK", "OSE.JPN"),
 IND_HK("IND.HK", "Asia Indexes", "IND.HK", "OSE.JPN");
 private String locationCode;
 private String displayName;
 private String instruments;
 private String routeExchange;
 
 public String toString() {
		return locationCode;
 }
 
 public String getLocationCode() {
	return locationCode;
}

public String getDisplayName() {
	return displayName;
}

public String getInstruments() {
	return instruments;
}

public String getRouteExchange() {
	return routeExchange;
}

Location(String locationCode, String displayName, String instruments, String routeExchange) {
		this.locationCode = locationCode;
		this.displayName = displayName;
		this.instruments = instruments;
		this.routeExchange = routeExchange;
 }
 
 public static Location toClass(String value) {
	for(Location symbol: values()) {
		if(symbol.toString().equals(value)) {
			return symbol;
		}
	}
	throw new IllegalArgumentException("Value '"+value+"' not defined as constant.");
 }
}